package servlet.servlet_yaobo;

import net.sf.json.JSONObject;
import pojo.MembershipManagement;
import pojo.User;
import service.impl.ImpShoppingMemberService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;

/**
 * 用于修改会员信息
 */
@WebServlet(value = "/cations")
public class ModificationServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        User use=new User();
        use.setuID(Integer.parseInt( req.getParameter("u_id")));
        use.setuAccount(req.getParameter("account"));
        use.setuNickName(req.getParameter("nickname"));
        use.setuPhoneNumber(req.getParameter("phonenumber"));
        use.setuEmail(req.getParameter("email"));
        use.setuIntegral(Integer.parseInt(req.getParameter("integral")));
        use.setuGender(Integer.parseInt(req.getParameter("sex")));
        use.setuAddress(req.getParameter("address"));
        ImpShoppingMemberService imp=new ImpShoppingMemberService();
        imp.memberModification(use);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       doGet(req,resp);
    }
}
